package manager

import (
	"pq/dto"
	"pq/repository"
)
func NewNormalSubjectManager() *NormalSubjectManager{
	nsm := &NormalSubjectManager{}
	nsm.repo = & repository.SubjectRepository{}
	return nsm
}
type NormalSubjectManager struct{
	repo *repository.SubjectRepository
}
func (nsm *NormalSubjectManager)GetInfo(subjectId int) dto.SubjectDto{
	subjectDto := dto.NewSubjectDto()
	subjectDto.Set("id",subjectId)
	subjectEntity := nsm.repo.GetInfo(subjectDto)
	subjectDto.Set("body",subjectEntity.Body)
	subjectDto.Set("lib_id",subjectEntity.PqCsTestLibraryId)
	return subjectDto
}
func (nsm *NormalSubjectManager)SetToResource(subjectDto dto.SubjectDto){
	repo := & repository.SubjectRepository{}
	repo.SetToResource(subjectDto)
}

func (nsm *NormalSubjectManager)Delete(subjectDto dto.SubjectDto)(int64,error){
	repo := & repository.SubjectRepository{}
	return repo.Delete(subjectDto)
}